<?php

class Zend_View_Helper_Jsonarraytotable extends Zend_View_Helper_Abstract {

    public function jsonarraytotable($jsonconfig) {
        return $this->generateList($jsonconfig);
    }

    public function generateList($jsonconfig = "") {
        if ($jsonconfig != "") {
            $configarray = json_decode($jsonconfig);
          # $returnString = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"inner-standard-table\"><tbody>";
            $returnString = "<table border='1'><tr><td><b>parameter</b></td><td><b>value</b></td></tr>";
            foreach ($configarray as $name => $value) {
              #  $returnString .= "<tr><td style=\"font-size: 0.80em;\">$name</td><td>$value</td></tr>";
                $returnString .= "<tr><td>$name</td><td>$value</td></tr>";
            }
            $returnString .= "</table>";
            #$returnString .= "</tbody></table>";
        } else {
            $returnString = "";
        }
        return $returnString;
    }

}
/*
<br> <table>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
 * 
 */
?>